<template>
    <div class="table-container">
        <h-table
                :list="list"
                :total="total"
                :options="options"
                :operates="operates"
                :columns="setting.columns"
                @pagination="getDataInfo"
                @handleSelectionChange="handleSelectionChange"
        />
        <pagination
                v-show="total > 0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getDataInfo"
        />
    </div>
</template>

<script>
import setting from './setting'
    export default {
        name: "ggtable",
        data() {
            return {
                setting: setting,
                list:[],
                total:22,
                queryParams:{
                    pageNum: 1,
                    pageSize: 10
                },
                options:{// table 配置的参数
                    stripe: true,
                    loading: false,
                    highlightCurrentRow: true,
                    mutiSelect: true
                },
                operates: {// table 配置的参数
                    width: 180,
                    fixed: "right",
                    label: "操作",
                    list: [
                        {
                            id: "mdf", label: "修改", type: "primary", plain:true, show: true, disabled: false,
                            method: (index, row) => {}
                        },
                        {
                            id: "ddd", label: "删除", type: "danger", plain:true, show: true, disabled: false,
                            method: (index, row) => {}
                        }
                    ]
                }
            }
        },
        created() {
            let _ = this
            _.getDataInfo()
        },
        methods: {
            /** */
            getDataInfo() {
                let _ = this
                console.log('queryParams',_.queryParams)
                _.options.loading = true
                _.list = setting.data
                // const {data: res} = await _.$H.post(_.$A.tableList, queryParams)
                // _.list = res.data.list
                // _.total.value = res.data.total
                _.options.loading = false
                console.log('handleLogin',_.list)

            },
            handleSelectionChange(val){
                console.log('handleSelectionChange',val)
            }
        },
        mounted() {
        },
        watch: {},
        computed: {},
        destroyed() {
        }
    }
</script>

<style lang="less" scoped>
@import "index.less";
</style>
